package com.opengw.configuration.publish;


import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.opengw.configuration.entity.Content;
import com.opengw.configuration.route.Route;

@Entity
@Table(name = "publish_wsdl")
public class WSDLPublish extends BasePublish implements Serializable{

	private static final long serialVersionUID = 7930202934307628403L;
	private Route wsdlRoute;
	private Route endPointRoute;
	private boolean fromFile;
	private String originalWSDLUrl;
	private Content originalWSDLContent;
	
	public void setWsdlRoute(Route wsdlRoute) {
		this.wsdlRoute = wsdlRoute;
	}
	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinColumn(name="wsdl_route_ref")
	public Route getWsdlRoute() {
		return wsdlRoute;
	}
	public void setEndPointRoute(Route endPointRoute) {
		this.endPointRoute = endPointRoute;
	}
	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinColumn(name="endpoint_route_ref")	
	public Route getEndPointRoute() {
		return endPointRoute;
	}
	public void setOriginalWSDLUrl(String originalWSDLUrl) {
		this.originalWSDLUrl = originalWSDLUrl;
	}
	@Column(name = "original_wsdl_url")	
	public String getOriginalWSDLUrl() {
		return originalWSDLUrl;
	}
	public void setOriginalWSDLContent(Content originalWSDLContent) {
		this.originalWSDLContent = originalWSDLContent;
	}
	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinColumn(name="content_ref")
	public Content getOriginalWSDLContent() {
		return originalWSDLContent;
	}
	public void setFromFile(boolean fromFile) {
		this.fromFile = fromFile;
	}
	@Column(name = "from_file")
	public boolean isFromFile() {
		return fromFile;
	}
}
